/**
 *====================================================
 * 文件名称: ContainerInventoryHistoryEntity.java
 * 修订记录：
 * No    日期				作者(操作:具体内容)
 * 1.    2016年5月24日			chenxy(创建:创建文件)
 *====================================================
 * 类描述：(说明未实现或其它不应生成javadoc的内容)
 */
package com.yuexunit.finance.project.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.yuexunit.finance.project.entity.lexicon.AbnormalStateEnum;
import com.yuexunit.finance.project.entity.lexicon.AbnormalTypeEnum;

/**
 * @ClassName: ContainerInventoryHistoryEntity
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author chenxy
 * @date 2016年5月24日 下午2:55:32
 */
@Entity
@Table(name = "FIN_CONTAINER_INVENTORY_HISTORY")
public class ContainerInventoryHistoryEntity implements Cloneable {

	/** 箱理货历史记录ID */
	@Id
	@GeneratedValue
	@Column(name = "INVENTORY_HISTORY_ID")
	private Long inventoryHistoryId;

	/** 货箱清单ID */
	@Column(name = "INVENTORY_ID")
	private Long inventoryId;

	/** 融资企业ID */
	@Column(name = "ENTERPRISE_ID")
	private Long enterpriseId;

	/** 融资企业名称 */
	@Column(name = "ENTERPRISE_NAME")
	private String enterpriseName;

	/** 融资信息ID */
	@Column(name = "FINANCE_ID")
	private Long financeId;

	/** 融资信息编号 */
	@Column(name = "FINANCE_NUMBER")
	private String financeNumber;

	/** 收货通知ID */
	@Column(name = "RECIEVE_NOTICE_ID")
	private Long recieveNoticeId;

	/** 理货单ID */
	@Column(name = "TALLYING_ID")
	private Long tallyingId;

	/** 理货物流公司ID */
	@Column(name = "TALLYING_COMPANY_ID")
	private Long tallyingCompanyId;

	/** 理货状态 0:待理货/1:已理货 */
	@Column(name = "TALLYING_STATE")
	private Boolean tallyingState;

	/** 理货时间 */
	@Column(name = "TALLY_DT")
	private Date tallyDateTime;

	/** 物流运单号 */
	@Column(name = "WAYBILL_NUMBER")
	private String waybillNumber;

	/** 货物箱号 */
	@Column(name = "CASE_NUMBER")
	private String caseNumber;

	/** 箱型尺寸 */
	@Column(name = "CASE_SIZE")
	private String caseSize;

	/** 箱型 */
	@Column(name = "MODEL")
	private String model;

	/** 尺寸 */
	@Column(name = "DIMENSION")
	private String dimension;

	/** 铅封号 */
	@Column(name = "FACING_SLIP")
	private String facingSlip;

	/** 铅封号2 */
	@Column(name = "FACING_SLIP_NEXT")
	private String facingSlipNext;

	/** 异常标注 0:异常/1:正常 */
	@Column(name = "ABNORMAL")
	private Boolean abnormal;

	/** 异常类型 0:未知/1:理货异常 */
	@Column(name = "ABNORMAL_TYPE")
	private AbnormalTypeEnum abnormalType;

	/** 异常类别 0:未知/1:货损/2:丢失 */
	@Column(name = "ABNORMAL_STATE")
	private AbnormalStateEnum abnormalState;

	/** 理货地点 */
	@Column(name = "TALLY_ADDRESS")
	private String tallyAddress;

	/** 理货经度 */
	@Column(name = "TALLY_LONGITUDE")
	private BigDecimal tallyLongitude;

	/** 理货纬度 */
	@Column(name = "TALLY_LATITUDE")
	private BigDecimal tallyLatitude;

	/** 理货前图片 */
	@Column(name = "TALLY_PRE_FILE")
	private String tallyPreFile;

	/** 理货后图片 */
	@Column(name = "TALLY_SUFFIX_FILE")
	private String tallySuffixFile;

	/** 理货说明 */
	@Column(name = "TALLY_REMARK")
	private String tallyRemark;

	/** 异常理货地点 */
	@Column(name = "TALLY_EX_ADDRESS")
	private String tallyExAddress;

	/** 异常理货经度 */
	@Column(name = "TALLY_EX_LONGITUDE")
	private BigDecimal tallyExLongitude;

	/** 异常理货纬度 */
	@Column(name = "TALLY_EX_LATITUDE")
	private BigDecimal tallyExLatitude;

	/** 异常理货说明 */
	@Column(name = "TALLY_EX_REMARK")
	private String tallyExRemark;

	/** 异常录音文件 */
	@Column(name = "TALLY_EX_SOUND_RECORDE")
	private String tallyExSoundRecorde;

	/** 异常图片信息 */
	@Column(name = "TALLY_EX_ABNORMAL_FILE")
	private String tallyExAbnormalFile;

	/** 异常类型 0:未知/1:货损/2:丢失 */
	@Column(name = "TALLY_EX_ABNORMAL_STATE")
	private AbnormalStateEnum tallyExAbnormalState;
	
	/** 磅单 */
	@Column(name = "POUNDS_OF_SIGN")
	private String poundsOfSign;
	
	/** 物流公司ID */
	@Column(name="LOGISTICS_COMPANY_ID")
	private Long logisticsCompanyInfoId; 

	public Long getLogisticsCompanyInfoId() {
		return logisticsCompanyInfoId;
	}

	public void setLogisticsCompanyInfoId(Long logisticsCompanyInfoId) {
		this.logisticsCompanyInfoId = logisticsCompanyInfoId;
	}

	private transient List<ContainerBulkstockHistoryEntity> containerBulkstockHistories;

	public String getPoundsOfSign() {
		return poundsOfSign;
	}

	public void setPoundsOfSign(String poundsOfSign) {
		this.poundsOfSign = poundsOfSign;
	}

	public Long getInventoryHistoryId() {
		return inventoryHistoryId;
	}

	public void setInventoryHistoryId(Long inventoryHistoryId) {
		this.inventoryHistoryId = inventoryHistoryId;
	}

	public Long getInventoryId() {
		return inventoryId;
	}

	public void setInventoryId(Long inventoryId) {
		this.inventoryId = inventoryId;
	}

	public Long getRecieveNoticeId() {
		return recieveNoticeId;
	}

	public void setRecieveNoticeId(Long recieveNoticeId) {
		this.recieveNoticeId = recieveNoticeId;
	}

	public Long getTallyingId() {
		return tallyingId;
	}

	public void setTallyingId(Long tallyingId) {
		this.tallyingId = tallyingId;
	}

	public Long getTallyingCompanyId() {
		return tallyingCompanyId;
	}

	public void setTallyingCompanyId(Long tallyingCompanyId) {
		this.tallyingCompanyId = tallyingCompanyId;
	}

	public String getWaybillNumber() {
		return waybillNumber;
	}

	public void setWaybillNumber(String waybillNumber) {
		this.waybillNumber = waybillNumber;
	}

	public String getCaseNumber() {
		return caseNumber;
	}

	public void setCaseNumber(String caseNumber) {
		this.caseNumber = caseNumber;
	}

	public String getCaseSize() {
		return caseSize;
	}

	public void setCaseSize(String caseSize) {
		this.caseSize = caseSize;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getDimension() {
		return dimension;
	}

	public void setDimension(String dimension) {
		this.dimension = dimension;
	}

	public String getFacingSlip() {
		return facingSlip;
	}

	public void setFacingSlip(String facingSlip) {
		this.facingSlip = facingSlip;
	}

	public String getFacingSlipNext() {
		return facingSlipNext;
	}

	public void setFacingSlipNext(String facingSlipNext) {
		this.facingSlipNext = facingSlipNext;
	}

	public Boolean getAbnormal() {
		return abnormal;
	}

	public void setAbnormal(Boolean abnormal) {
		this.abnormal = abnormal;
	}

	public AbnormalTypeEnum getAbnormalType() {
		return abnormalType;
	}

	public void setAbnormalType(AbnormalTypeEnum abnormalType) {
		this.abnormalType = abnormalType;
	}

	public AbnormalStateEnum getAbnormalState() {
		return abnormalState;
	}

	public void setAbnormalState(AbnormalStateEnum abnormalState) {
		this.abnormalState = abnormalState;
	}

	public String getTallyAddress() {
		return tallyAddress;
	}

	public void setTallyAddress(String tallyAddress) {
		this.tallyAddress = tallyAddress;
	}

	public BigDecimal getTallyLongitude() {
		return tallyLongitude;
	}

	public void setTallyLongitude(BigDecimal tallyLongitude) {
		this.tallyLongitude = tallyLongitude;
	}

	public BigDecimal getTallyLatitude() {
		return tallyLatitude;
	}

	public void setTallyLatitude(BigDecimal tallyLatitude) {
		this.tallyLatitude = tallyLatitude;
	}

	public String getTallyPreFile() {
		return tallyPreFile;
	}

	public void setTallyPreFile(String tallyPreFile) {
		this.tallyPreFile = tallyPreFile;
	}

	public String getTallySuffixFile() {
		return tallySuffixFile;
	}

	public void setTallySuffixFile(String tallySuffixFile) {
		this.tallySuffixFile = tallySuffixFile;
	}

	public String getTallyRemark() {
		return tallyRemark;
	}

	public void setTallyRemark(String tallyRemark) {
		this.tallyRemark = tallyRemark;
	}

	public String getTallyExAddress() {
		return tallyExAddress;
	}

	public void setTallyExAddress(String tallyExAddress) {
		this.tallyExAddress = tallyExAddress;
	}

	public BigDecimal getTallyExLongitude() {
		return tallyExLongitude;
	}

	public void setTallyExLongitude(BigDecimal tallyExLongitude) {
		this.tallyExLongitude = tallyExLongitude;
	}

	public BigDecimal getTallyExLatitude() {
		return tallyExLatitude;
	}

	public void setTallyExLatitude(BigDecimal tallyExLatitude) {
		this.tallyExLatitude = tallyExLatitude;
	}

	public String getTallyExRemark() {
		return tallyExRemark;
	}

	public void setTallyExRemark(String tallyExRemark) {
		this.tallyExRemark = tallyExRemark;
	}

	public String getTallyExSoundRecorde() {
		return tallyExSoundRecorde;
	}

	public void setTallyExSoundRecorde(String tallyExSoundRecorde) {
		this.tallyExSoundRecorde = tallyExSoundRecorde;
	}

	public String getTallyExAbnormalFile() {
		return tallyExAbnormalFile;
	}

	public void setTallyExAbnormalFile(String tallyExAbnormalFile) {
		this.tallyExAbnormalFile = tallyExAbnormalFile;
	}

	public AbnormalStateEnum getTallyExAbnormalState() {
		return tallyExAbnormalState;
	}

	public void setTallyExAbnormalState(AbnormalStateEnum tallyExAbnormalState) {
		this.tallyExAbnormalState = tallyExAbnormalState;
	}

	public Long getEnterpriseId() {
		return enterpriseId;
	}

	public void setEnterpriseId(Long enterpriseId) {
		this.enterpriseId = enterpriseId;
	}

	public String getEnterpriseName() {
		return enterpriseName;
	}

	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}

	public Long getFinanceId() {
		return financeId;
	}

	public void setFinanceId(Long financeId) {
		this.financeId = financeId;
	}

	public String getFinanceNumber() {
		return financeNumber;
	}

	public void setFinanceNumber(String financeNumber) {
		this.financeNumber = financeNumber;
	}

	public Boolean getTallyingState() {
		return tallyingState;
	}

	public void setTallyingState(Boolean tallyingState) {
		this.tallyingState = tallyingState;
	}

	public Date getTallyDateTime() {
		return tallyDateTime;
	}

	public void setTallyDateTime(Date tallyDateTime) {
		this.tallyDateTime = tallyDateTime;
	}

	public List<ContainerBulkstockHistoryEntity> getContainerBulkstockHistories() {
		return containerBulkstockHistories;
	}

	public void setContainerBulkstockHistories(List<ContainerBulkstockHistoryEntity> containerBulkstockHistories) {
		this.containerBulkstockHistories = containerBulkstockHistories;
	}

	// ========================================================================================================================================================================//
	public boolean validateAbnormal() {
		return !this.abnormal.booleanValue();
	}

	@Override
	public ContainerInventoryHistoryEntity clone() {
		ContainerInventoryHistoryEntity o = null;
		try {
			o = (ContainerInventoryHistoryEntity) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return o;
	}

}
